package nowcoder.duoduo1;

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[][] lines = new int[num][2];
        for(int i = 0; i < num; i++){
            int Li = sc.nextInt();
            int Ri = sc.nextInt();
            lines[i][0] = Li;
            lines[i][1] = Ri;
        }
        if(canContain(lines)) System.out.println("true");
        else System.out.println("false");
    }

    private static boolean canContain(int[][] lines){
        Arrays.sort(lines, (o1, o2) -> {
            if(o1[0] == o2[0]) return o2[1]-o1[1];
            else return o1[0]-o2[0];
        });
        for(int i = 0; i < lines.length; i++){
            for(int j = i+1; j < lines.length; j++){
                if(lines[j][1] <= lines[i][1]) return true;
            }
        }
        return false;
    }

}
